// Terminal.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
#include <strsafe.h>

#define BUFSIZE 512

// Variaveis
HANDLE hTimer;
HANDLE hSlotExibeDados;
HANDLE hSlotExibeAlarmes;
LPTSTR mailslotExibeDados = TEXT("\\\\.\\mailslot\\mailslotExibeDados");
LPTSTR mailslotExibeAlarmes = TEXT("\\\\.\\mailslot\\mailslotExibeAlarmes");

// Prototipos
VOID CALLBACK ExibeDados(PVOID, BOOLEAN);
VOID CALLBACK ExibeAlarmes(PVOID, BOOLEAN);
BOOL WINAPI MakeDadoSlot(LPTSTR);
BOOL WINAPI MakeAlarmeSlot(LPTSTR);
BOOL ReadSlot();

int _tmain(int argc, _TCHAR* argv[])
{
	MakeDadoSlot(mailslotExibeDados);
	MakeAlarmeSlot(mailslotExibeAlarmes);
	
	CreateTimerQueueTimer(&hTimer, NULL, (WAITORTIMERCALLBACK)ExibeDados, NULL, 0, 100, 0);
	CreateTimerQueueTimer(&hTimer, NULL, (WAITORTIMERCALLBACK)ExibeAlarmes, NULL, 0, 100, 0);

	getchar();
	return 0;
}

